const koa = require('koa')

const app = new koa()

const main = ctx=>{
  // console.log(ctx.request.url)
  switch (ctx.request.url) {
    case '/':
      ctx.response.type = 'html'
      ctx.response.body = '<h1>Hello World</h1>'
      break;
  
    default:
      ctx.response.type = 'html'
      ctx.response.body = '<a href="/">Index Page</a>'
      break;
  }
}

app.use(main)
app.listen(3000)